Flattens a 2D array into a new collection. The items are copied row by row.
Example usage:
short[][] array = [[0, 1], [2, 3]] assert array.flatten() == [0, 1, 2, 3]
A transpose method for 2D short arrays.
Example usage:
short[][] shorts = [[1, 10], [100, 1000]] short[][] expected = [[1, 100], [10, 1000]] def result = shorts.transpose() assert result == expected assert shorts.class.componentType == result.class.componentType